package br.edu.ifpb.calculator;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Arrays;

public class Application {

	
	public static void main(String[] args) throws MalformedURLException, RemoteException, AlreadyBoundException, NotBoundException {
		//registro do RMI
		Registry registry = LocateRegistry.createRegistry(10999);
		//instanciando o serviço
		Service service = new ServiceImpl();
		//disponibilizando o serviço
		registry.bind(Service.NAME, service);
		//
		System.out.println(Arrays.toString(registry.list()));
		//remover o registro do serviço
		//registry.unbind(Service.NAME);
	}

}
